{include file="header.html"}
<script src="/js/ckeditor/ckeditor.js"></script>
<style type="text/css">
.input1{
	float: right;
	margin: -7px 0px 0px -30px;
	display: inline-block;
	width: 65%;
}
.oo{
	padding-left: 12px !important;
}
.form{
	margin-top: 30px !important;
}
</style>
<div class="page-header">
	<h6>
		优惠劵管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			优惠劵添加
		</small>
	</h6>
</div><!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
	<form class="form-horizontal form" role="form" method="post" action="?app=coupon&act=add" enctype="multipart/form-data">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="name"> 优惠劵名称 </label>
			<div class="col-sm-10">
				<input type="text" id="name" name="name" value="" class="col-xs-6" />
			</div>
		</div>
		<!-- <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="postion"> 使用位置 </label>
			<div class="col-sm-10">
				<input type="text" id="postion" name="postion" value="" class="col-xs-6" />
			</div>
		</div> -->
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="coupon_money"> 面额 </label>
			<div class="col-sm-10">
				<input type="number" id="coupon_money" name="coupon_money" value="" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="status"> 使用条件 </label>
			<div class="col-sm-10">
				<div class="radio">
					<label>
						<input type="radio" name="min" value="1" checked class="ace price2" />
						<span class="lbl" id="nunu" style="display:inline-block;"> 満 
							<input type="number" id="min_price" name="min_price" value="" class="col-xs-2 input1">
						</span>
					</label>
				</div>
				<div class="radio">
					<label>
						<input type="radio" name="min" value="0" class="ace price" />
						<span class="lbl"> 无条件 </span>
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="begin_time"> 有效时间 </label>
			<div class="col-sm-10">
				<input type="text" id="begin_time" name="begin_time" value="" class="col-xs-3" /><span class="col-xs-1" style="width:50px;font-weight:600;line-height:38px;">---</span>
				<input type="text" id="end_time" name="end_time" value="" class="col-xs-3" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="quantity"> 发行量 </label>
			<div class="col-sm-10">
				<input type="number" id="quantity" name="quantity" value="" class="col-xs-2" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="num_per_person"> 每人限领 </label>
			<div class="col-sm-10">
				<input type="number" id="num_per_person" name="num_per_person" value="" class="col-xs-2" />张
			</div>
		</div>
			<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="offline_use"> 使用范围 </label>
			<div class="col-sm-10">
				<div class="radio">
					<label>
						<input type="radio" name="offline_use" value="1" checked class="ace" />
						<span class="lbl"> 线下 </span>
					</label>
				</div>
				<div class="radio">
					<label>
						<input type="radio" name="offline_use" value="0" class="ace" />
						<span class="lbl"> 通用 </span>
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="permit_goods"> 是否限制商品使用范围 </label>
			<div class="col-sm-10">
				<select name="permit_goods" onchange="showGoods(this)">
                        <option value="0">不限制</option>
                        <option value="1">限制</option>
                 </select>
			</div>
		</div>
		<div class="form-group" id="all_goods">
		<label class="col-sm-2 control-label no-padding-right" for="offline_use"></label>
			<div class="col-sm-10">
				<span id="goods"></span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" style="text-align:right;" for="status"> 状态 </label>
			<div class="col-sm-10">
				<div class="radio">
					<label>
						<input type="radio" name="status" value="1" checked class="ace" />
						<span class="lbl"> 正常 </span>
					</label>
				</div>
				<div class="radio">
					<label>
						<input type="radio" name="status" value="0" class="ace" />
						<span class="lbl"> 隐藏 </span>
					</label>
				</div>
			</div>
		</div>

		<div class="clearfix form-actions">
			<div class="col-md-offset-3 col-md-9">
				<button class="btn btn-info" type="submit">
					<i class="ace-icon fa fa-check bigger-110"></i>
					提交
				</button>

				&nbsp; &nbsp; &nbsp;
				<button class="btn" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i>
					重置
				</button>
			</div>
		</div>
	</form>
</div>
</div>
<script type="text/javascript">
    function showGoods(obj){
        // document.getElementById("extra_url").style.display="none";
        var iWidth=720;                          //弹出窗口的宽度;
        var iHeight=600;                         //弹出窗口的高度;
        var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
        var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
        var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+iWidth+",height="+iHeight+",top="+iTop+",left="+iLeft;
        switch(obj.value)
        {
            case "0":
                document.getElementById("goods").style.display="none";
                document.getElementById("all_goods").innerHTML="";
                break;
            case "1":
                window.open("?app=goods&act=choose","",features);
                break;
            default:
                break;
        }
    }
    function onDel(id)
    {
        if(confirm("是否删除？")){
            var picdiv = document.getElementById(id);
            picdiv.parentNode.removeChild(picdiv);
            if(document.getElementById("goods").childNodes.length==0)
            {
                 document.getElementById("all_goods").style.display="none";
            }
        }
    }
    $(function(){
	$('#begin_time').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
	$('#end_time').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
});
</script>
{include file="footer.html"}